﻿@model CategoryModel
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";
    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);

    var canonicalUrlsEnabled = EngineContext.Current.Resolve<SeoSettings>().CanonicalUrlsEnabled;
    if (canonicalUrlsEnabled)
    {
        var categoryUrl = Url.RouteUrl("Category", new { SeName = Model.SeName }, this.Request.Url.Scheme);
        Html.AddCanonicalUrlParts(categoryUrl);
    }

    var breadcrumbDelimiter = EngineContext.Current.Resolve<CommonSettings>().BreadcrumbDelimiter;
}
@using Nop.Core.Domain.Common;
@using Nop.Core.Domain.Seo;
@using Nop.Core.Infrastructure;
@using Nop.Web.Models.Catalog;
@using Nop.Web.Extensions;
@*category breadcrumb*@
@if (Model.DisplayCategoryBreadcrumb)
{
    <div class="custom-page-box-border-less-div">
    
        <div class="breadcrumbs">
            <ol class="breadcrumb">
            
                <li><a href="@Url.RouteUrl("HomePage")" title="@T("Categories.Breadcrumb.Top")">@T("Categories.Breadcrumb.Top")</a></li>
                @foreach (var cat in Model.CategoryBreadcrumb)
                {
                    var isLastCategory = cat.Id == Model.Id;
            
                    if (isLastCategory)
                    {   
                        <li class="active">@cat.Name</li>
                    }
                    else
                    {
                        <li><a href="@Url.RouteUrl("Category", new { SeName = cat.SeName })" title="@cat.Name">@cat.Name</a></li>
                    }
            
                }
            
            </ol>
        </div>
    </div>




    @Html.Widget("categorydetails_after_breadcrumb")
}
<div class="features_items"><!--features_items-->
    <h2 class="title text-center">@Model.Name</h2>
    <div class="custom-page-box-border-less-div">
        @Html.Widget("categorydetails_top")
        @*description*@
        @if (!String.IsNullOrWhiteSpace(Model.Description))
        {
            <div class="category-description">
                @Html.Raw(Model.Description)
            </div>
        }
        @Html.Widget("categorydetails_before_subcategories")
        @*subcategories*@
        @if (Model.SubCategories.Count > 0)
        {
            <div class="row">
                @foreach (var item in Model.SubCategories)
                {
                
                    <div class="col-md-3"> 
                        <div class="product-image-wrapper">
                            <div class="single-products">
                                <div class="productinfo text-center">
                                    <a href="@Url.RouteUrl("Category", new { SeName = item.SeName })" title="@item.PictureModel.Title"><img alt="@item.PictureModel.AlternateText" src="@item.PictureModel.ImageUrl"
                                         title="@item.PictureModel.Title" /></a>
                                    
                                    <p><a href="@Url.RouteUrl("Category", new { SeName = item.SeName })" title="@item.PictureModel.Title">
                                        @item.Name</a></p>
                                    
                                </div>
												
                            </div>
                        </div>
                    </div>
                }
            </div>


 
                
        }
        
                
                
        <div class="row">
            <div class="col-md-12">
                                      
            
                <div class="product-selectors clearfix">
                   

                            
                    @*view mode*@
                    @if (Model.PagingFilteringContext.AllowProductViewModeChanging && Model.Products.Count > 0)
                    {
                        <div class="col-md-4 pull-text-center ">
                            <div class="row filtering-navigation-item filtering-navigation-item-one">
                                <div class="col-md-5 remove_right_padding">
                                   
                                    <div class="breadcrumbs pull-right">
                                        <ol class="breadcrumb">
                                            <li><a>@T("Categories.ViewMode")</a></li>
                                        </ol>
                                    </div>

                                </div>
																			

																			


                                <div class="col-md-6 remove_left_padding form-two text-left">
                                    <form class="pull-left">@Html.DropDownList("products-viewmode", Model.PagingFilteringContext.AvailableViewModes, new { @class = "", onchange = "setLocation(this.value);" })</form>
                                    
                                </div>
                            </div>
                        </div>
                    }
                    @*sorting*@
                    @if (Model.PagingFilteringContext.AllowProductSorting && Model.Products.Count > 0)
                    {
                        <div class="col-md-4 pull-text-center">
                            <div class="row  filtering-navigation-item filtering-navigation-item-two">
                                <div class="col-md-5 remove_right_padding">
                                    <div class="breadcrumbs pull-right">
                                        <ol class="breadcrumb">
                                            <li><a>@T("Categories.OrderBy")</a></li>
                                        </ol>
                                    </div>
                                </div>


                                

                                <div class="col-md-8 remove_left_padding form-two">
                                    <form class="pull-left">@Html.DropDownList("products-orderby", Model.PagingFilteringContext.AvailableSortOptions, new { @class = "", onchange = "setLocation(this.value);" })</form>
                                </div>
                            </div>                  
                        </div>
                    }
                    @*page size*@
                    @if (Model.PagingFilteringContext.AllowCustomersToSelectPageSize && Model.Products.Count > 0)
                    {
                        <div class="col-md-4 pull-text-center">
                            <div class="row filtering-navigation-item filtering-navigation-item-three">
                                
                                <div class="col-md-6 remove_right_padding ">
                                    <div class="breadcrumbs pull-right">
                                        <ol class="breadcrumb">
                                            <li><a>@T("Categories.PageSize") @T("Categories.PageSize.PerPage")</a></li>
                                        </ol>
                                    </div>
                                </div>

                                
                                <div class="col-md-5 remove_left_padding remove_right_padding form-two customed-form-two pull-right">
                                    <form class="pull-left">@Html.DropDownList("products-pagesize", Model.PagingFilteringContext.PageSizeOptions, new { @class = "", onchange = "setLocation(this.value);" })</form>
                                </div>
                               
                            </div>
                        </div>
                    }
                </div>
                       


            </div>
                    
        </div>
        <div class="clearfix space15px"></div>
  

        @Html.Widget("categorydetails_before_filters")
        @section left
        {
            <div class="product-filters-wrapper">
                @*filtering*@
                @if (Model.PagingFilteringContext.PriceRangeFilter.Enabled)
                {
                    @Html.Partial("_FilterPriceBox", Model.PagingFilteringContext.PriceRangeFilter, new ViewDataDictionary())
                }
                @*filtering*@
                @if (Model.PagingFilteringContext.SpecificationFilter.Enabled)
                {
                    @Html.Partial("_FilterSpecsBox", Model.PagingFilteringContext.SpecificationFilter, new ViewDataDictionary())
                }
            </div>
        }
        @Html.Widget("categorydetails_before_product_list")
        @*product list*@
        @if (Model.Products.Count > 0)
        {
            if (Model.PagingFilteringContext.ViewMode == "list")
            {
                     @*list mode*@
                <div class="product-list">
                    
                    @foreach (var product in Model.Products)
                    {
                        <div class="row">
                            
                        
                            <div class="col-md-12">
                                <div class="offer offer-default">
                                    @Html.Partial("_ProductBox", product)
                                </div>
                            </div>
                        </div>

                        
                    }
                </div>       
            }
            else
            {
                    @*grid mode*@

                <div class="product-grid home-page-product-grid">
                    <div class="row ">
                    
                        @foreach (var product in Model.Products)
                        {

                            <div class="col-md-4">
                                <div class="offer offer-default silde-show-offer pull-text-center">
                                    @Html.Partial("_ProductBox", product)
                                </div>
                            </div>

                        }
                    </div>
                </div>

                
            }
        }
        <div class="pagination-area">
            <div class="pagination">
                @Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber")
            </div>
           
        </div>


        
        @Html.Widget("categorydetails_bottom")
    </div>

						
</div>




@Html.Widget("categorydetails_after_featured_products")
@*featured products*@
@if (Model.FeaturedProducts.Count > 0)
{
   

    var best_i = 0;
    <div class="recommended_items"><!--recommended_items-->
        <h2 class="title text-center">@T("Products.FeaturedProducts")</h2>
						
        <div id="recommended-item-carousel-2" class="carousel slide" data-ride="carousel">
            <div class="carousel-inner">
                @foreach (var item in Model.FeaturedProducts)
                {
                    if(best_i%3==0)
                    {
                        if(best_i==0)
                        {
                            @:<div class="item active">
                            @:<div class="row" >    
                        }else
                        {
                            @:<div class="item">
                            @:<div class="row" >  
                        }
                        

                            

                    }
                    <div class="col-lg-4">
                        <div class="offer offer-default silde-show-offer pull-text-center">
                            @Html.Partial("_ProductBox", item)
                        </div>

                    </div>


                    if(best_i%3==2)
                    {
                        @:</div> 
                        @:</div> 
                    }
                    best_i++;
                }
                @if(best_i%3!=0)
                {
                    @:</div> 
                    @:</div> 
                }
                
            </div>
            <a class="left recommended-item-control" href="#recommended-item-carousel-2" data-slide="prev">
                <i class="fa fa-angle-left"></i>
            </a>
            <a class="right recommended-item-control" href="#recommended-item-carousel-2" data-slide="next">
                <i class="fa fa-angle-right"></i>
            </a>			
        </div>
    </div>



}
@Html.Widget("categorydetails_before_featured_products")

<script type="text/javascript">
    $(document).ready(function () {
        $("#show-more-subctegory-button").on("click",function () {
            $(".show-more-subcategory-div").each(function () {
                $(this).css({
                   display:"block" 
                });
            });
        });
    });
</script>